Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
vfile-sort
Advanced tools
vfile
utility to sort messages.
This is a small package to sort the list of messages.
It first sorts by line/column: earlier messages come first.
When two messages occurr at the same place, sorts fatal error before warnings,
before info messages.
Finally, it sorts using localeCompare
on source
, ruleId
, or finally
reason
.
You can use this right before a reporter is used to give humans a coherent report.
This package is ESM only. In Node.js (version 14.14+ and 16.0+), install with npm:
npm install vfile-sort
In Deno with esm.sh
:
import {sort} from 'https://esm.sh/vfile-sort@3'
In browsers with esm.sh
:
<script type="module">
import {sort} from 'https://esm.sh/vfile-sort@3?bundle'
</script>
import {VFile} from 'vfile'
import {sort} from 'vfile-sort'
const file = VFile()
file.message('Error!', {line: 3, column: 1})
file.message('Another!', {line: 2, column: 2})
sort(file)
console.log(file.messages.map(d => String(d)))
// => ['2:2: Another!', '3:1: Error!']
This package exports the identifier sort
.
There is no default export.
sort(file)
Sort messages in the given vfile.
file
(VFile
)
— file to sortSorted file (VFile
).
This package is fully typed with TypeScript. It exports no additional types.
Projects maintained by the unified collective are compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. Our projects sometimes work with older versions, but this is not guaranteed.
See contributing.md
in vfile/.github
for ways to
get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
vfile utility to sort messages by line/column
The npm package vfile-sort receives a total of 294,358 weekly downloads. As such, vfile-sort popularity was classified as popular.
We found that vfile-sort demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.